
SWEP.PrintName = "SMG"
SWEP.WorldModel = "models/weapons/w_smg1.mdl"
SWEP.Automatic = true
SWEP.BuggyOffset = Vector( 2,-1.9,4 )
SWEP.Offset = Vector( 4,0,-1 )
-- Currently no support for class deriving.

function SWEP:PrimaryAttack( targetEnt )
	-- targetEnt is any entity that the player has locked onto.
	if self.Owner:GetMana() < 5 then return end
	
	if ( SERVER ) then
		self.Owner:SetMana( self.Owner:GetMana() - 5 )
	end
	
	local AimVec = self.Owner:GetFakeAimVector()
	if ( CLIENT ) then
		if self.Owner == LocalPlayer() then
			local m_x, m_y = gui.MousePos()
			AimVec = ScreenToVector( m_x, m_y )
		end
	end
	
	self:FireBullet( targetEnt, self:GetShootPos(), AimVec )
	
	self:NextAttack( CurTime() + 0.1 )
end

function SWEP:Think()
end

function SWEP:DrawHUD()

	local m_x, m_y = gui.MousePos()
	self:DrawCrosshair( m_x, m_y, 2 ) -- MouseX, MouseY, Speed at which the crosshair rotates.

end
